package com.hhkj.study.api.goods.controller;

import com.hhkj.study.api.goods.service.biz.ApiGoodsBizService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.login.api.ApiLoginOpen;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author luowu
 * @Date 2024/10/9 涵 13:38:02
 */
@RestController
@RequestMapping("/api/goods")
public class ApiGoodsController {

    @Resource
    private ApiGoodsBizService apiGoodsBizService;

    /**
     * 商品详情
     * @param goodsId
     * @return
     */
    @ApiLoginOpen
    @GetMapping("/{id}")
    public AjaxResult getGoodsDetailById(@PathVariable("id") Long goodsId) {
        return AjaxResult.success(apiGoodsBizService.getGoodsDetailById(goodsId));
    }

}
